{% extends "base.html" %}
{% load staticfiles %}
{% block title %} 用户信息 {% endblock title %}
{% block content %}
<div class="container">
  <div class="row">
    <div class="col-12">
      <br>
      <div class="col-md-4">用户名：{{ user.username }}</div>
      <br>

     {% if profile.avatar %}
        <div class="form-group col-md-4">头像</div>
        <img src="{{ profile.avatar.url }}"  style="max-width: 20%; border-radius: 15%" class="col-md-4">
     {% else %}
        <h5 class="col-md-4">暂无头像</h5>
     {% endif %}
      <br><br>
      <form action="." enctype="multipart/form-data" method="post">
        {% csrf_token %}
         <!-- avatar -->
        <div class="form-group col-md-4">
          <label for="avatar">上传头像</label>
          <input type="file" class="form-control-file" id="avatar" name="avatar">
        </div>

        <!-- phone -->
        <div class="form-group col-md-4">
          <label for="phone">手机号</label>
          <input type="text" class="form-control" id="phone" name="phone" value="{{ profile.phone }}">
        </div>
        <!-- bio -->
        <div class="form-group col-md-4">
          <label for="bio">简介</label>
          <textarea type="text" class="form-control" id="bio" name="bio" rows="12">{{ profile.bio }}</textarea>
         <!-- 提交按钮 -->
        <button class="btn btn-primary" type="submit">提交</button></div>
      </form>
    </div>
  </div>
</div>
{% endblock content %}